{%include file="header.html" %}  


<div class="login_body">
<div class="break"></div>

<div class="login_bg_div">

	<div class="login">
	<h3 class="share_layer_title">注册</h3>
	
	<div class="main_login">
	<ul class="login_ul">
	<li>帐号：<div class="login_input"><input type="text" name="user_name" value=""  id="user_name" ></div></li>
	<li>密码：<div class="login_input"><input type="password" name="password" value="" id="password"></div></li>
	<li class="login_button">
	<div><span class="submit btn-large"><a id="btnSubmit" class="submit_a"><b  style="color:#ffffff;">确 定</b></a></span>
	
	</div>
	<input type="hidden" name="url" id="url" value="{%$g_show.url%}">
	</li>
	
	</ul>
	</div>
	</div>

</div>

</div>

<script src ="/js/jquery/jquery.js"></script>
<script type="text/javascript" language="javascript">

$(".login_bg_div").bind("keypress",function(e){
			//alert(e.keyCode);
			if(e.keyCode == 13){
				$("#btnSubmit").focus();
				$("#btnSubmit").click();
			}
});


</script>

<script type="text/javascript" language="javascript">

$("#btnSubmit").bind("click",function(){
	$.ajax({
		url:"/user/register_post.php",
		type:"post",
		data:"user_name="+$("#user_name").val()+"&password="+$("#password").val(),
		dataType:"json",
    complete:function(xhr,status){
      var result = eval("("+(xhr.responseText)+")");
			
			if(result.error == "0"){
				location.href = $("#url").val();               
			}else{
				var errmsg = result.errmsg;
				alert(errmsg)
			}

			widget = null;
		}
	});
});
</script>
{%include file="footer.html" %}   


